package sc.helper;

import java.io.FileInputStream;
import java.util.Properties;

public class Constants {

	private static Properties properties = new Properties();
	
	private final static String propFile = "sc.properties";
	
	static {
		try {
			properties.load(new FileInputStream(propFile));
		} catch (Exception e) {
			System.out.println("Could not find properties file: " + propFile);
			properties.setProperty("TCP_PORT", "80");
			properties.setProperty("UDP_LISTEN_PORT", "6111");
			properties.setProperty("UDP_GAME_PORT", "6112");
			properties.setProperty("TCP_HOST", "localhost");
			properties.setProperty("UDP_RECEIVE_HOST", "localhost");
			properties.setProperty("UDP_SEND_HOST", "localhost");
		}
	}
	
	public final static int TCP_PORT = Integer.parseInt(properties.getProperty("TCP_PORT"));

	public final static int UDP_LISTEN_PORT = Integer.parseInt(properties.getProperty("UDP_LISTEN_PORT"));
	
	public final static int UDP_GAME_PORT = Integer.parseInt(properties.getProperty("UDP_GAME_PORT"));

	public final static String TCP_HOST = properties.getProperty("TCP_HOST");

	public final static String UDP_RECEIVE_HOST = properties.getProperty("UDP_RECEIVE_HOST");

	public final static String UDP_SEND_HOST = properties.getProperty("UDP_SEND_HOST");

}
